package com.example.demo.ProxyMode;

/**
 * 游戏者(动态代理)
 */
public class GamePlayer3 implements IGamePlayer3{

    private String name;

    // 构造函数限制谁能创建对象，并同时传递姓名
    public GamePlayer3(String name){
            this.name = name;
    }

    @Override
    public void login(String user, String password) {
        System.out.println("登录名为" + user+"的用户" + this.name + "登录成功");
    }

    @Override
    public void killBoss() {
        System.out.println(this.name + "打怪");
    }

    @Override
    public void upgrade() {
        System.out.println(this.name + "升级");
    }
}
